package com.smartcampusbackend.mapper;

import com.smartcampusbackend.model.SchoolAccount;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface SchoolAccountMapper {
    @Select("SELECT * FROM school_account WHERE account_name = #{accountName} LIMIT 1")
    SchoolAccount selectByAccountName(@Param("accountName") String accountName);

    @Update("UPDATE school_account SET balance = balance + #{amount} WHERE account_name = #{accountName}")
    int updateBalance(@Param("accountName") String accountName, @Param("amount") java.math.BigDecimal amount);
} 